#include "salonscreen.h"
#include "ui_salonscreen.h"

salonScreen::salonScreen(Fenetre* f, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::salonScreen),
    fen(f)
{
    ui->setupUi(this);

    QObject::connect(ui->bQuit, SIGNAL(clicked()), fen, SLOT(slotQuitSalon()));
    QObject::connect(ui->bReady, SIGNAL(clicked()), this, SLOT(slotReady()));
    QObject::connect(this, SIGNAL(ready()), fen, SLOT(slotReady()));
}

salonScreen::~salonScreen()
{
    delete ui;
}

void salonScreen::slotReady()
{
    ui->bReady->setEnabled(false);

    emit ready();
}

void salonScreen::setNomPartie(QString q)
{
    ui->lNomPartie->setText(q);
}

void salonScreen::addClient(QString q)
{
    ui->listeJoueurs->append(q);
}

void salonScreen::clearClients()
{
    ui->listeJoueurs->clear();
}
